package com.yyh.service.impl;

import com.yyh.entity.Roles;
import com.yyh.entity.Userroles;
import com.yyh.mapper.UserrolesMapper;
import com.yyh.service.IUserrolesService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author yangyueheng
 * @since 2020-06-02
 */
@Service
public class UserrolesServiceImpl extends ServiceImpl<UserrolesMapper, Userroles> implements IUserrolesService {
	@Autowired
	UserrolesMapper mapper;

	@Override
	public List<Roles> getRolesByUsersId(Integer uid) {
		return mapper.getRolesByUsersId(uid);
	}

	@Override
	public boolean removeRolesByUserId(Integer uid, String rids) {
		String[] arr = rids.split(",");
		return mapper.removeRolesByUserId(uid, arr);
	}

}
